package com.aegean.MonitorExamSYS.conduction.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.center.business.CenterBusiness;
import com.aegean.MonitorExamSYS.conduction.business.ConductionBusiness;
import com.opensymphony.xwork2.ActionSupport;
@Controller("editMonitorState")
@Scope("prototype")
public class editMonitorState extends ActionSupport {
	@Resource
	ConductionBusiness business;
	private int[] monitor_Ids;
	private int state;
	private boolean success;
	private String msg;
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public int[] getMonitor_Ids() {
		return monitor_Ids;
	}
	public void setMonitor_Ids(int[] monitor_Ids) {
		this.monitor_Ids = monitor_Ids;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String passed() throws Exception {
		// TODO Auto-generated method stub
		success=business.passedState(state, monitor_Ids);
		if(success==true){
		  msg="审核通过......";	
		}else{
			msg="审核通过失败......";
		}
		return SUCCESS;
	}
	public String defused() throws Exception {
		// TODO Auto-generated method stub
		success=business.defuseState(state, monitor_Ids);
		if(success==true){
			msg="停止监考成功......";
			}else{
				msg="停止监考失败......";
			}
	
		return SUCCESS;
	}
	

}
